package com.gistone.commis.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import lombok.*;

import java.util.Date;
/**
 * Created by wangfan on 2017/5/10.
 */
@Getter
@Setter
@ToString
@AllArgsConstructor
@NoArgsConstructor
public class HouseLog {
    private Integer logId;

    private Integer houseId;

    private Integer communityId;
    private Community community;

    private Integer departId;
    private  Depart depart;

    private Integer userId;
    private  User user;

    private String houseName;

    private String houseAdd;
    @JsonFormat(pattern="yyyy-MM-dd")
    private Date completedTime;

    private String serviceCondition;

    private Double houseArea;

    private String remarks;
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date registerTime;

    private String houseType;

    private String acquireWay;

    private String fundFrom;
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    private Integer updateUserId;
    private  User alterUser;

    private Integer isDelete;

    public HouseLog(Integer logId, Integer houseId, Integer communityId, Integer departId, Integer userId, String houseName, String houseAdd, Date completedTime, String serviceCondition, Double houseArea, String remarks, Date registerTime, String houseType, String acquireWay, String fundFrom, Date updateTime, Integer updateUserId,Integer isDelete) {
        this.logId = logId;
        this.houseId = houseId;
        this.communityId = communityId;
        this.departId = departId;
        this.userId = userId;
        this.houseName = houseName;
        this.houseAdd = houseAdd;
        this.completedTime = completedTime;
        this.serviceCondition = serviceCondition;
        this.houseArea = houseArea;
        this.remarks = remarks;
        this.registerTime = registerTime;
        this.houseType = houseType;
        this.acquireWay = acquireWay;
        this.fundFrom = fundFrom;
        this.updateTime = updateTime;
        this.updateUserId = updateUserId;
        this.isDelete=isDelete;
    }

    public HouseLog(House h, Date updateTime, Integer updateUserId) {
        this.setCommunityId(h.getCommunityId());
        this.setUserId(h.getUserId());
        this.setHouseId(h.getHouseId());
        this.setDepartId(h.getDepartId());
        this.setHouseName(h.getHouseName());
        this.setHouseAdd(h.getHouseAdd());
        this.setCompletedTime(h.getCompletedTime());
        this.setServiceCondition(h.getServiceCondition());
        this.setHouseArea(h.getHouseArea());
        this.setRemarks(h.getRemarks());
        this.setRegisterTime(h.getRegisterTime());
        this.setHouseType(h.getHouseType());
        this.setFundFrom(h.getFundFrom());
        this.setAcquireWay(h.getAcquireWay());
        this.setIsDelete(h.getIsDelete());
        this.updateTime = updateTime;
        this.updateUserId = updateUserId;
    }
}